/*
 * @Author: zhanglianchang
 * @Date: 2020-08-01 14:39:32
 * @Last Modified by: taoshiwei
 * @Last Modified time: 2019-04-29 14:49:44
 *
 * 题库有关的接口：自己写吧~~  已经被张老师删了 ^_^
 */
import { createAPI } from '@/utils/request'

// 基础题库列表
export const list = data => createAPI('/questions', 'get', data)

// 基础题库详情
export const detail = data => createAPI(`/questions/${data.id}`, 'get', data)

// 批量导入题
export const batch = data => createAPI('/questions/batch', 'post', data)

// 基础题库添加
export const add = data => createAPI('/questions', 'post', data)

// 基础题库修改
export const update = data => createAPI(`/questions/${data.id}`, 'put', data)

// 基础题库删除
export const remove = data => createAPI(`/questions/${data.id}`, 'delete', data)

// 精选题库加入取消
export const choiceAdd = data =>
  createAPI(`/questions/choice/${data.id}/${data.choiceState}`, 'patch', data)

// 组题列表
export const getQuestionRandomList = data =>
  createAPI('/questions/randoms', 'get', data)
// 组题列表删除
export const delQuestionRandomList = data =>
  createAPI(`/questions/randoms/${data.id}`, 'delete', data)
// 基础题库详情
// export const detail = data => createAPI(`/questions/${data.id}`, 'get', data)
// 获取精选试题列表
export const getAllChoice = data => createAPI('/questions/choice', 'get', data)
// 试题审核
export const checkState = data =>
  createAPI(`/questions/check/${data.id}`, 'POST', data)
// 精选题库上下架
export const choicePublishState = data =>
  createAPI(`/questions/choice/${data.id}/${data.publishState}`, 'post', data)
// 移除精选
export const removeChoice = data =>
  createAPI(`/questions/choice/${data.id}/${data.choiceState}`, 'patch', data)
// 学科列表
export const list2 = data => createAPI('/subjects', 'get', data)
// 二级目录
export const twoLeveList = data => createAPI('/subjects', 'get', data)
// 录入人
export const creatorList = data => createAPI('/users/', 'get', data)
